import { configureStore } from '@reduxjs/toolkit';

import ReduxThunk from 'redux-thunk';
import ReduxPromise from 'redux-promise';

import CityReducer from './features/citySlice';
import CinemaReducer from './features/cinemaSlice';
import FilmReducer from './features/filmSlice';
import TabbarReducer from './features/tabbarSlice';

const reducer = {
  CityReducer,
  TabbarReducer,
  CinemaReducer,
  FilmReducer,
};

const store = configureStore({
  reducer,
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware().concat(ReduxThunk, ReduxPromise),
});

export { store };
